// 登出组件类
class Logout {
    constructor() {
        var that = this;
        $("#logout").on("touchstart", function() {
            that._removeSessionStorage();
            that.setLocalStorageLogout();
            location.href = LoginInit_URL;
        });
    }

    // 清空sessionStorage临时存储
    _removeSessionStorage() {
        sessionStorage.removeItem("tltd_loginName");
        sessionStorage.removeItem("tltd_token");
        sessionStorage.removeItem("tltd_loginType");
        sessionStorage.removeItem("tltd_openid");
        sessionStorage.removeItem("tltd_brhId");
    }

    // 修改长期存储 localStorage logoutVal
    setLocalStorageLogout() {
        localStorage.setItem("logoutVal", "1");
    }
}

export{
    Logout
}